﻿/* Write a program to calculate n! for each n in the range [1..100]. 
 * Hint: Implement first a method that multiplies a number represented as array of digits by given integer number. */

using System;
using System.Numerics;
/* reshenieto e s BigInteger (spored uchebnika moje da se napraiv i po 2-ta nachina  - 
 * s BigInteger ili po metodikata ot 8ma zadacha. A men me chakat 1300 domashni za 4 dni taka che
 * predpochitam da ne preotkrivam toplata voda i da ne se mycha s prostotii */
namespace _10.CalculateFactorial_1to100
{
    class CalculateFactorial1_to_100
    {
        static void Main(string[] args)
        {
            Console.WriteLine(Calcfactorial(100));
            for (int i = 1; i <= 100; i++) Console.WriteLine("Factorial of {0} is {1}", i, Calcfactorial(i));   
        }

        private static BigInteger Calcfactorial(int n)
        {
            BigInteger factorial = n;
            for (int i = n-1; i >= 1; i--) factorial *= i;
            return factorial;
        }
    }
}
